package com.mhc.suzuki.manager.impl;

import com.mhc.suzuki.dal.mapper.ext.WaitingTaskStaffExtMapper;
import com.mhc.suzuki.dal.model.WaitingTaskStaffDO;
import com.mhc.suzuki.dal.query.WaitingTaskStaffQuery;
import com.mhc.suzuki.manager.WaitingTaskStaffManager;
import com.subaru.common.query.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for WaitingTaskStaff.
 */

@Component
public class WaitingTaskStaffManagerImpl implements WaitingTaskStaffManager {


    @Autowired
    protected WaitingTaskStaffExtMapper waitingTaskStaffExtMapper;

    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(WaitingTaskStaffQuery query) {
        return waitingTaskStaffExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(WaitingTaskStaffQuery query) {
        return waitingTaskStaffExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(WaitingTaskStaffDO record) {
        return waitingTaskStaffExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(WaitingTaskStaffDO record) {
        return waitingTaskStaffExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<WaitingTaskStaffDO> selectByQuery(WaitingTaskStaffQuery query) {
        return waitingTaskStaffExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
     */
    @Override
    public PageResult<WaitingTaskStaffDO> selectByQueryWithPage(WaitingTaskStaffQuery query) {
        PageResult<WaitingTaskStaffDO> result = new PageResult<WaitingTaskStaffDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public WaitingTaskStaffDO selectByPrimaryKey(Long id) {
        return waitingTaskStaffExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective(WaitingTaskStaffDO record, WaitingTaskStaffQuery query) {
        return waitingTaskStaffExtMapper.updateByQuerySelective(record, query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery(WaitingTaskStaffDO record, WaitingTaskStaffQuery query) {

        return waitingTaskStaffExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(WaitingTaskStaffDO record) {
        return waitingTaskStaffExtMapper.updateByPrimaryKeySelective(record);
    }
}
